# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=kldap
pkgver=23.08.4
pkgrel=0
pkgdesc="LDAP access API for KDE"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://kontact.kde.org/"
license="LGPL-2.0-or-later"
depends_dev="
	kcompletion5-dev
	kdoctools5-dev
	ki18n5-dev
	kio5-dev
	kwidgetsaddons5-dev
	openldap-dev
	qtkeychain-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	cyrus-sasl-dev
	samurai
	"
_repo_url="https://invent.kde.org/pim/kldap.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kldap-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
340ba36cb36aa7081746cfc6d54c85c70bf9df8859c9cb7ecf30d2a059f6c6b2072d87fc49afa7e937e399d480decba795ffe9a0df38c40c5dd665ca436119d0  kldap-23.08.4.tar.xz
"
